package wh.coach._class;

/**
 * @author hangwen
 * @date 2023/6/20
 */
public class Sub1 extends Base {

    private static String NAME = "Sub1";

    private String name = "subName";

    public Sub1() {
        super();
        System.out.println(this.getClass().getSimpleName() + ",执行Sub1()");
    }

    public Sub1(String name) {
        super(name);
        System.out.println(this.getClass().getSimpleName() + ",执行Sub1(name)");
    }

    public static String getNAME() {
        return Sub1.NAME;
    }

    @Override
    public String getName() {
        return "sub:" + super.getName();
    }

    public String getSubName() {
        return name;
    }

    public String getSuperPackageName() {
        //同包内 可访问包级别方法 与是否是子类无关
        return super.getPackageName();
    }

    public String getSuperProtectedName() {
        //子类可访问保护级别方法
        return super.getProtectedName();
    }

}
